# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created: Tue Jul 10 14:34:00 2012
#      by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui

import OL
import launcher
import dl
import globales
import threading
import thread_fiches


##def action():
##    global data
##
##    try :
##        data = parse.getAnimes()
##        thread_fiches.run()
##    except:
##        data = None
##        recup.recupAnimes()
##        action()
        
    
import sys
app = QtGui.QApplication(sys.argv)

globales.dl = dl.Dl_class()

launch = QtGui.QMainWindow()
Fenetre_principale = QtGui.QMainWindow()

ui_launch = launcher.Ui_launch()
ui = OL.Ui_Fenetre_principale()

QtCore.QObject.connect(ui_launch,QtCore.SIGNAL("PrepareCaching()"),ui.prepareCaching)
QtCore.QObject.connect(ui,QtCore.SIGNAL("Ready(QObject)"),ui_launch.ready)

ui_launch.setupUi(launch)

launch.show()


ui.setupUi(Fenetre_principale)

QtCore.QObject.connect(globales.dl,QtCore.SIGNAL("pourcentage(int)"),ui.newValueToBar)
QtCore.QObject.connect(globales.dl,QtCore.SIGNAL("Statuts(QString)"),ui.modifStatut)
QtCore.QObject.connect(globales.dl,QtCore.SIGNAL("Prepare()"),ui.newValueToBar)
QtCore.QObject.connect(globales.dl,QtCore.SIGNAL("prepareAffichage(QString, float)"),ui.prepareAffichage)
QtCore.QObject.connect(globales.dl,QtCore.SIGNAL("Defilement()"),ui.defilList)

globales.pause = False
globales.kill = False
app.exec_()
globales.kill = True
thread_fiches.stop()
#sys.exit()

